package main

import (
	pb "grpc/grpc_0/service/proto/consignment"
)

const (
	port = ":50051"
)

type IRepository interface {
	Create(*pb.Consignment) (*pb.Consignment, error)
}

type Repository struct {
	consignments []*pb.Consignment
}

func (repo *Repository) Create(consignment *pb.Consignment) (*pb.Consignment, error) {
	//update := append(repo.consignments, consignment)
	//repo.consignments = update

	repo.consignments = append(repo.consignments, consignment)
	return consignment, nil
}

type service struct {
	repo IRepository
}


